#!/bin/sh
#
# Start qt demo
#

pid_file=/var/run/qtdemo.pid

# Start qt demo
#. /etc/init.d/qt.sh
#export HOME=/root

stop_demo()
{
	if [ -f $pid_file ];then
		echo "Stop qt demo ..."
		kill `cat $pid_file`
		rm -rf $pid_file
	fi
}

start_demo()
{
	echo "Start qt demo ..."
	cd /opt/qt-4.8.5/demos/fluidlauncher/
    ./fluidlauncher -qws 2>/dev/null&

	echo $! | tee $pid_file
}

case "$1" in
  start)
	stop_demo
	start_demo
	;;
  stop)
	stop_demo
	;;
  restart|reload)
	stop_demo
	start_demo
	;;
  *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

exit $?

